<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
          $table->charset = 'utf8';
          $table->collation = 'utf8_general_ci';
          $table->increments('id',11);
          $table->string('name',255)->nullable(true)->comment("用户名称");
          $table->string('avatar',255)->nullable(true)->comment("用户头像");
          $table->string('phone_number',60)->nullable(true)->comment("用户手机号");
          $table->string('email',60)->nullable(true)->comment("用户邮箱")->unique();
          $table->string('openid',255)->nullable(true)->comment("用户openid");
          $table->boolean('is_member')->comment("用户是否是会员:false不是会员，true是会员");
          $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
